// ignore_for_file: file_names, must_be_immutable

// 无状态组件, 纯展示用的组件
import 'package:flutter/material.dart';

class MyApp1 extends StatelessWidget {
  MyApp1({super.key, required this.age});

  int age;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        // 1.1 导航
        appBar: AppBar(
          title: const Text('无状态组件'),
          backgroundColor: Colors.pink,
        ),
        // 1.2 主体内容
        body: Center(
          child: Text('我叫无状态组件, 今年$age岁'),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            // setState(() {
            //   age++;
            // });
          },
          tooltip: 'Increment',
          child: const Icon(Icons.add),
        ));
  }
}
